Il existe de multiples options informatiques pour faire de la stylométrie. Nous nous proposons, dans ce cours, d’utiliser le package R nommé Stylo, mais d’autres options existent comme FactoMineR. Ce package étant développé par des français de l’agrocampus de Rennes, notons qu’une importante documentation en français est disponible, et permettra aux personnes intéressées de continuer leur apprentissage de la stylométrie.
Ce cours est disponible en ligne avec le corpus que nous utilisons dans ce notebook: on peut le trouver sur notre Github. Il est distribué avec une licence CC-BY.
Le corpus est constitué de pièces de théâtre du XVIIe siècle, disponibles sur le site www.theatre-classique.fr, rassemblées par J.-B. Camps (Ecole des Chartes) et adaptées par nous-mêmes pour correspondre aux besoins de ce cours.
Stylo est développé par Maciej Eder (Cravocie), Mike Kestmont (Anvers) et Jan Rybicki (Cravocie). On trouvera de nombreuses ressources sur le site de leur groupe de computational stylistics et sur leur GitHub, qui contient un repo consacré au package stylo avec de nombreuses informations sur son fonctionnement.
Pour ceux qui voudraient s’entraîner avec d’autres données que celles fournies pour le cours, un repo avec 100 romans anglais se trouve sur leur GitHub (cliquez sur le bouton vert Clone or download à droite pour télécharger le tout au format zip).
Stylo et de RSi depuis le début nous parlons de “package R”, et non de “logiciel”, c’est que Stylo utlise le langage R. R est un langage de programmation libre dédié aux statistiques et à la science des données, et Stylo un de ses packages, c’est-à-dire (pour simplifier) qu’il contient un fichier d’aide (minimal) et une somme de commandes préprogrammées en R qui nous évite d’écrire tout le code nécessaire pour effectuer un calcul précis – comme un théorème, qui permet de ne pas avoir à écrire toute la démonstration mathématique. Dans l’absolu, il est possible de se passer du package Stylo si on a (beaucoup) de temps à perdre.
Comme R est un langage, il nécessite une console pour être exécuté. Deux options s’offre à (l’apprenti) programmeur:
GNU R permettra aux plus motivés (et aux plus politisés) de travailler sur un logiciel entièrement libre (on peut le télécharger ici).Shiny). Nous avons décidé de l’utiliser pour ce cours car il permet l’écriture de notesbooks, comme celui que vous lisez à présent, et simplifie considérablement le travail pour les grands débutants en informatique.Stylo a besoin de savoir où chercher les données (pour nous il s’agit de notre corpus) qu’il va utiliser, et celles-ci doivent impérativement obéir à trois règles simples:
corpus ne doit contenir que les fichiers du corpus: tout autre document se retrouverait analysé avec le reste, et perturberait les résultats.txt, soit en XML, soit en HTML.Nous devons préparer la session de travail, en désignant à R le fichier de notre ordinateur à partir duquel nous allons travailler pour qu’il trouve notre fichier corpus, et qu’il y sauvegarde nos résultats.
Pour indiquer où se trouve le fichier de travail, deux solutions sont possibles:
Session>Set Working Directory>Choose DirectoryR avec la commande setwd (pour Set working directory), qui s’utilise de cette manière.setwd("~/GitHub/2018_Cours_ENS/2_Stylo")
Attention! Il convient de donner le chemin qui corredpond à votre configuration locale. Une fois la chose faite, cliquez sur Run (le bouton qui ressemble à play, à droite de la commande supra).
On peut vérifier que le chemin vers le dossier de travail a bien été pris en compte avec une autre commande: getwd (pour Get working directory):
getwd()
[1] "/Users/gabaysimon/GitHub/2018_Cours_ENS/2_Stylo"
Tout est en ordre? Avançons!
styloCertaines commandes sont directement disponibles (comme setwd ou getwd), mais d’autres pas: elles sont contenues dans un package à télécharger. C’est le cas de celles que nous utilisons en stylométrie, et nous devons donc les installer (un peu comme dans LaTeX, pour ceux qui connaissent).
Pour cela, nous utilisons la commande install.packages. Si le package n’est pas encore installé, retirez le # au début de la ligne infra et cliquez sur Run (le bouton qui ressemble à play, à droite de la commande supra).
install.packages("stylo")
Error in install.packages : Updating loaded packages
Attention! avoir le pacakage ne signifie pas qu’il est utilisable, de la même manière qu’avoir un livre ne suffit pas pour qu’on puisse le lire: il faut le sortir de la bibliothèque, et l’emmener sur son lieu de lecture. Nous devons installer le package en allant le chercher dans la bibliothèque où il vient d’être déposé. Pour cela nous avons désormais besoin de la commande… library! Encore une fois, cliquez sur Run (il faudra répéter cette action à chaque commande tout au long de ce cours).
library(stylo)
package ‘stylo’ was built under R version 3.4.4
### stylo version: 0.6.7 ###
If you plan to cite this software (please do!), use the following reference:
Eder, M., Rybicki, J. and Kestemont, M. (2016). Stylometry with R:
a package for computational text analysis. R Journal 8(1): 107-121.
<https://journal.r-project.org/archive/2016/RJ-2016-007/index.html>
To get full BibTeX entry, type: citation("stylo")
Il ne nous reste plus qu’à lancer stylo, avec la commande… stylo()!
styloL’application Stylo peut être utilisée en ligne de commande, mais aussi avec une GUI (graphical user interface, en français “interface graphique”). Si vous voulez avoir un premier aperçu, retirez le # au début de la ligne infra et cliquez sur Run.
stylo()
using current directory...
Error in if (tolower(language) == "polish") pronouns = pol.pronouns :
argument is of length zero
Nous allons désormais tenter une première analyse de cluster. Le data clustering (ou “partitionnement de données” en français) cherche à diviser un ensemble de données en différents “groupes” homogènes selon des caractéristiques qu’ils partagent. Ces groupes (dans notre cas des pièces de théâtre) sont formés à partir de calculs qui déterminent leur proximité (similarité ou distance).
Note importante Afin de gagner du temps, nous avons directement paramétré le formulaire de la GUI, mais la commande stylo() vide, comme précédemment (cf. 2.1), suffirait si les bonnes cases sont bien cochées.
Lorsque vous appuyerez sur Run observez la console: une série de messages vous avertit de ce qu’il se passe.
stylo(gui=TRUE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr=100,
analysis.type = "CA", distance.measure = "manhattan",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating Manhattan distances...
MFW used: 100
Function call:
stylo(gui = TRUE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "CA", distance.measure = "manhattan", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
it.deserves.a.nobel.prize = stylo()
this will create a class "it.deserves.a.nobel.prize" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(it.deserves.a.nobel.prize)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Reprenons le processus dans ses grandes lignes:
loading…: Une fois la commande lancée, chaque texte est est chargé.Total nr. of samples…: On nous avertit du nombre de textes dans le corpus, qui sont tous éclatés en tokens (ici des mots).combining frequencies…: Le nombre d’occurrence de chaque token est calculé pour chaque document du corpus, pour former un tableau de fréquences.Calculating Manhattan distance: ces tableaux de fréquences permettent de voir si certains tokens reviennent de manière équivalente dans d’autres documents, et de produire les clusters. Nous allons revenir plusieurs fois sur ce point par la suite.Regardons maintenant le graphique qui nous est donné. Il s’agit d’un dendogramme, qui est accompagné de quelques informations en bas de page (100 MFW Culled @ 0% Manhattan distance):
100 MFW Nous avons utilisé les 100 mots les plus fréquents. Pendant le traitement des données, Stylo a généré quelques fichiers qui nous permettent de voir quels sont ces mots, ainsi que leur fréquence. Allez dans votre dossier de travail, et regardez les documents wordlist.txt et table_with_frequencies.txt. Nous reviendrons plus tard sur ces données.Culled @ 0%: Le culling est à 0%, ce qui signifie que les mots les plus fréquents peuvent être absents de certains textes. Un culling à 100% signifierait que nous ne retiendrions que les mots les plus fréquents retenus dans tous les textes.Manhattan distance: Nous avons utilisé la distance dite “de Manhattan”, mais il en existe d’autres:
Nous avons obtenu un cluster: il est plausible, mais est-il fiable? Nous avons besoin d’encore plus de certitudes… Une première solution est de répéter le même clacul, en augmentant le nombre des mots les plus fréquents: passons de 100 à 1000.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 1000, mfw.max = 100, mfw.incr=100,
analysis.type = "CA", distance.measure = "manhattan",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating Manhattan distances...
MFW used: 1000
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 1000, mfw.max = 100, mfw.incr = 100, analysis.type = "CA", distance.measure = "manhattan", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
publishable.results = stylo()
this will create a class "publishable.results" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(publishable.results)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Les résultat est déjà moins net… À quel moment du bruit a-t-il commencé à perturber la formation des groupes? Afin de le savoir, nous pouvons demander à Stylo de répéter l’analyse de cluster un certain nombre de fois entre 100 et 1000.
Demandons à Stylo de refaire le calculs dix fois, en incrémentant de 100 à chaque fois.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr=100,
analysis.type = "CA", distance.measure = "manhattan",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating Manhattan distances...
MFW used: 100 200
300NANA
400NANA
500NANA
600NANA
700NANA
800NANA
900NANA
1000NANA
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr = 100, analysis.type = "CA", distance.measure = "manhattan", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
my.boss.will.love.it = stylo()
this will create a class "my.boss.will.love.it" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(my.boss.will.love.it)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Difficile cependant de comparer facilement 10 dendogrammes… Et comment faire pour 20, 30 ou 1000 dendogrammes?
Il est possible de représenter graphiquement la somme de ces informations: il s’agit du concensus tree (“arbre de consensus”, en français). Voyons la forme de ce graphique avec les résultats que nous venons d’obtenir.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr=100,
analysis.type = "BCT", consensus.strength = 0.5, distance.measure = "manhattan",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating Manhattan distances...
MFW used: 100 200 300 400 500 600 700 800 900 1000
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr = 100, analysis.type = "BCT", consensus.strength = 0.5, distance.measure = "manhattan", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
my.cool.results = stylo()
this will create a class "my.cool.results" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(my.cool.results)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
C’est l’occasion de changer dans la méthode de calcul de distance, pour vérifier les performances de chacune. Nous utilisions jusqu’à présent la “distance de Manhattan”, essayons cette fois avec une distance euclidienne.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr=100,
analysis.type = "BCT", consensus.strength = 0.5, distance.measure = "euclidean",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating Euclidean distances...
MFW used: 100 200 300 400 500 600 700 800 900 1000
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr = 100, analysis.type = "BCT", consensus.strength = 0.5, distance.measure = "euclidean", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
I.love.this.stuff = stylo()
this will create a class "I.love.this.stuff" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(I.love.this.stuff)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Et maintenant avec une distance typique de la stylométrie: la distance de Burrows (du nom de son inventeur, John Burrows), aussi appelée “classic delta”.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr=100,
analysis.type = "BCT", consensus.strength = 0.5, distance.measure = "delta",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating classic Delta distances...
MFW used: 100 200 300 400 500 600 700 800 900 1000
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 1000, mfw.incr = 100, analysis.type = "BCT", consensus.strength = 0.5, distance.measure = "delta", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
my.discovery = stylo()
this will create a class "my.discovery" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(my.discovery)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Comparez les résultats obtenus avec ces différentes méthode de calcul. Réflechissez à ce dilemme: la différence entre les résultats signifie-t-elle
styloR permet de faire des calculs comme
1+1
[1] 2
ou
2-1
[1] 1
On peut créer des vecteurs, c’est-à-dire des liste de chiffres
c(1, 2, 3, 4, 5)
[1] 1 2 3 4 5
ou de chaînes de caractères (appelées strings en anglais) si on utilise des guillemets
c("a", "b", "c")
[1] "a" "b" "c"
Les chiffres, utilisés entre guillements, ne sont donc plus des chiffres mais de simples caractères: impossible de faire des calculs:
"1"+"1"
Error in "1" + "1" : non-numeric argument to binary operator
Ces données peuvent être importantes, et il peut être intéressant de les garder au cas où on en aurait besoin plus tard. On peut les stocker dans une variable, qui s’utilise comme suit:
variable = c("a", "b", "c")
La variable est ensuite appelée de cette manière
variable
[1] "a" "b" "c"
Elle permet donc de lire les résultats, qui ont été mis de côté.
Important Le nom de la variable est arbitraire, il peut donc être
truc = c("a", "b", "c")
truc
[1] "a" "b" "c"
ou encore
machinBiduleChouette = c("a", "b", "c")
machinBiduleChouette
[1] "a" "b" "c"
Les résultats stockés dans une variable peuvent être complexes, et permettre de faire des graphiques si ce sont des chiffres. Par exemple:
UneVariable = c(1, 1+2, 2*2, 3-1, 4/2)
plot(UneVariable)
Ces graphiques peuvent prendre plusieurs formes, comme une boxplot (“boîtee à moustaches” en français):
boxplot(UneVariable)
ou un histogramme:
hist(UneVariable)
Il est aussi possible d’avoir des informations statistiques nos données.
summary(UneVariable)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.0 2.0 2.0 2.4 3.0 4.0
Nous avons ici:
Min: Le minimum1st Qu.: Le premier quartile (au moins 25% des valeurs de la série sont inférieures), c’est un critère de dispersionMedian: La médianeMean: La moyenne3rd Qu.: Le troisième quartile (au moins 25% des valeurs de la série sont supérieurs), c’est un autre critère de dispersionMax.: Le maximumIl en va de même pour Stylo: le package découpe le texte de diverses manières, et réutilise ces données pour faire les graphiques que nous avons vus.
Les données utilisées pendant l’analyse stylométrique sont accessibles: pour les voir, nous devons donc créer une variable et les stocker . Appelons la variable “resultats”, qui s’utilise ainsi:
resultats = stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr=100,
analysis.type = "CA", distance.measure = "delta",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating classic Delta distances...
MFW used: 100
Voyons ce que nous donne cette variable:
resultats
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "CA", distance.measure = "delta", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
best.results.ever = stylo()
this will create a class "best.results.ever" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(best.results.ever)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Les données sont nombreuses: on nous redirige vers une sorte de portail avec les différentes données collectées, que l’on peut consulter avec le code suivant:
summary(resultats)
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "CA", distance.measure = "delta", pca.visual.flavour = "classic")
Available variables:
distance.table final distances between each pair of samples
features features (e.g. words, n-grams, ...) applied to data
features.actually.used features (e.g. frequent words) actually analyzed
frequencies.0.culling frequencies of words/features accross the corpus
list.of.edges edges of a network of stylometric similarities
table.with.all.freqs frequencies of words/features accross the corpus
table.with.all.zscores z-scored frequencies accross the corpus
These variables can be accessed by typing e.g.:
resultats$distance.table
Plusieurs variables sont diponibles. features permet d’afficher la liste des mots par ordre de fréquence:
resultats$features
---------------------------------------------------
features (e.g. words, n-grams, ...) applied to data
---------------------------------------------------
[1] de et que vous le
[6] je l à la un
[11] il est en d qu
[16] ce ne qui pour les
[21] mon me n si j
[26] m des on son ma
[31] mais plus a une pas
[36] par votre du dans moi
[41] sa elle bien au tout
[46] s nous lui sans c
[51] ai fait se tu mes
[56] point amour cette ses vos
[61] même peut sur coeur ces
[66] avec où être trop faire
[71] ou tous roi scène faut
[76] voir comme y t aux
[81] dont rien yeux leur quand
[86] suis te quoi ont âme
[91] sont enfin grand tant dieux
[96] non cet quel père ciel
[101] madame ton ils peu autre
[106] nos moins quelque donc sang
[111] jamais mort puis gloire ta
[116] ici vois veux ô seigneur
[121] contre honneur jour don aime
[126] deux prince avoir doit sort
[131] notre toujours toi après esprit
[136] mal avez soit veut temps
[141] aussi ah dit ainsi toute
[146] là assez peine encor fils
[151] dire seul va main vie
[156] oui encore sais dieu fois
[161] fort fille donne nom leurs
[166] mieux vient tes sous était
[171] dois ni pouvoir crime amant
[176] bras flamme frère foi reine
[181] fais état raison déjà dessein
[186] quelle vu hélas rendre lieux
[191] voeux malheur aujourd hui donner
[196] beau espoir pu fut heureux
[201] lieu première homme coup juste
[206] voit dis douleur jusqu ait
[211] grâce mains cour vertu autres
[216] haine courroux jours celui doux
[221] discours entre viens crois doute
[226] puisque ha parler monsieur devoir
[231] avait grands êtes hymen soins
[236] soeur chez secret courage ardeur
[241] autant laisse objet belle mourir
[246] bon trône fortune pleurs prendre
[251] loin parle faites aimer trouve
[256] vrai tel bonheur maître moment
[261] extrême rois mille effet puisse
[266] devant eux acte maux ose
[271] porte pourquoi vais eût malgré
[276] faveur toutes force rend croire
[281] digne sera sujet cher part
[286] chose seulement voyez soin vain
[291] allons phèdre reste sait cependant
[296] car destin victoire malheureux monde
[301] choix sens voulez colère terre
[306] bruit depuis triste éclat font
[311] funeste fureur seule v coups
[316] époux feu avant mérite allez
[321] princesse vers voix ii plutôt
[326] secours as lois mère semble
[331] ayant ceux peuple iii empire
[336] prix joie rang thésée cruel
[341] puisqu ennemis iv honte souffrir
[346] rival cela femme pris vainqueur
[351] place serait perdre hé nuit
[356] repos venger trépas trouver longtemps
[361] cent demande peur craindre perte
[366] bientôt haut corps zèle respect
[371] alors ordre lorsque paraître trouble
[376] premier savoir voilà coupable fidèle
[381] traître celle hippolyte malheurs mettre
[386] ennemi fit feux loi tête
[391] oeil orgueil beauté donné voici
[396] désirs généreux amitié appas aurait
[401] quelques horreur beaucoup envie pouvez
[406] heure puissance quels souvent bas
[411] ami combat glorieux lâche servir
[416] théâtre avais effort dessus jupiter
[421] aller chercher croit vengeance suivre
[426] voulu gens pitié armes été
[431] crains fin illustre sire su
[436] voyant aura estime grande plaisir
[441] couronne jaloux partout personne rigueur
[446] silence vue intérêt justice maîtresse
[451] paix vouloir aurais dites fasse
[456] sauver adieu cours crainte droit
[461] mis nature passion savez valeur
[466] larmes fatal besoin bonne garde
[471] sein sentiments venir soupirs afin
[476] étant grandeur plaire retour vivre
[481] comment faiblesse connaître croyez dès
[486] laissez cacher mien mot rodrigue
[491] amis visage bouche cause esther
[496] indigne noble charmes entendre sanche
[501] abord pays dedans ingrat offre
[506] palais entends faible hommes coeurs
[511] cieux connais laisser mépris désespoir
[516] trois dernier montrer nouveau parlez
[521] plaît sortir succès attendre avis
[526] offense sceptre toutefois cesse chacun
[531] choses prends fera jeune telle
[536] amoureux étais front humeur imprimer
[541] eut pourrait punir biens cherche
[546] chère chimène comte monstre près
[551] sorte combien demander fers prend
[556] régner traits conseil cru passe
[561] perfide saurait vit arcas nouvelle
[566] plein tiens univers aimé esprits
[571] venez aimable vôtre aucun chaque
[576] défendre eu naissance parmi propre
[581] aimez odieux outrage songez art
[586] auprès supplice attend cruelle sommes
[591] tendresse injuste péril permis souffre
[596] air ans désir presse tient
[601] desseins pieds plaindre regret sois
[606] transports agamemnon cède gardes guerre
[611] héros parole racine beaux cache
[616] léon perdu plaisirs sensible infante
[621] jusques montre paraît paris rage
[626] règne arrêt douleurs efforts excès
[631] mémoire sujets tantôt très alcandre
[636] milieu peux présent soleil vi
[641] ailleurs cassandre constance espérance faux
[646] vaincre amants attends aveu césar
[651] devez elles espère met porter
[656] rome suit violence i innocence
[661] maintenant pense appelle douceur espérer
[666] moindre regards triomphe victime adore
[671] écoute infidèle juge mortel suffit
[676] tomber vaut voudrais aurai aventure
[681] erreur foudre pièce adresse comédie
[686] demeure épée étrange instant quitter
[691] soient vertus ville importe maison
[696] parti pensée penser pourtant présence
[701] quelqu rendu tour tragédie auteur
[706] beautés bonté contraire craignez fer
[711] souffrez taire tourment audace aveugle
[716] léonore liberté lucipe oblige ôte
[721] propos craint exemple perds périr
[726] peuvent promis avecque bout orante
[731] perd recevoir sert titus action
[736] agir favorable histoire mots obéir
[741] privilège remède rends suite affaire
[746] arrête chemin ensemble hyménée moyen
[751] offrir songe abandonne aussitôt légitime
[756] obstacle pourrais prêt soi trouvé
[761] vis âge apprendre donnez douter
[766] effroi fédéric fuite rare service
[771] témoins conseils dernière isabelle juger
[776] manque oronte ouvrage quitte roger
[781] es ombre ôter port rendez
[786] tendre verra bons conserver innocent
[791] jalousie lit occasion prête prompt
[796] souvenir tombe vérité apparence avons
[801] davantage fallait ferai louis nérine
[806] tenir affront écouter fruit haïr
[811] long mériter puissant aisément ennui
[816] entretien lorsqu naître passer satisfaire
[821] soyez temple tort trahir mêmes
[826] prenez tombeau disgrâce enfants livre
[831] mienne pouvait prison quelquefois quoique
[836] reçu tyran achille affreux finir
[841] mérité pourra presque sacrifice côté
[846] entière exploits mauvais pareil qualité
[851] regarde secrets vont changement effets
[856] garder ouvre raisons sage arrêter
[861] barbare capable empêcher étonne faisant
[866] famille remords témoin vaine antoine
[871] appui assurer clitophon ennuis fameux
[876] ferme touche amours autel avantage
[881] darius demain destinée forte lettre
[886] majesté mortels nombre or ressentiment
[891] sentiment tirer trahison vii andromède
[896] autels connaît criminel défense dirai
[901] fatale haute hors lumière menace
[906] misérable nécessaire parce bérénice charme
[911] combattre dû esclave faits faute
[916] flatter injustice jette obliger tôt
[921] tue âmes fou jason lisette
[926] morts sache souci soupçons surtout
[931] tristes véritable amène confus cris
[936] découvrir désormais états faisons honteux
[941] hôtel lors orage résoudre satisfait
[946] spectacle surpris alcmène aricie choeur
[951] clarigène combats danger importune ingrate
[956] juifs justes médée pedre rompre
[961] surprise trait approche bontés engage
[966] fureurs genoux mari meure ouvrir
[971] tandis tremble venu accord arracher
[976] bois chambre droits fût partir
[981] phinée pleine poison querelle répondre
[986] rivale seront soupire téméraire armée
[991] brave certain change changer content
[996] fâcheux passé peines refus souverain
(total number of elements: 5000)
Ces mots sont classés du plus au moins fréquent dans le corpus. Nous pouvons voir leur fréquence par texte avec la variable table.with.all.freqs
resultats$table.with.all.freqs
------------------------------------------------
frequencies of words/features accross the corpus
------------------------------------------------
de et que vous le
BOYER_AGAMEMNON 3.2904149 2.3670178 1.8272857 1.7297438 1.4956431
BOYER_AMOURSJUPITERSEMELE 3.3849713 2.7663213 1.6597928 2.16779 1.7452973
BOYER_ARISTODEME 2.8586839 2.4734166 1.9648636 1.9417476 1.7645246
BOYER_ARTAXERCE 3.5923052 2.9386757 1.7111276 1.6420449 1.9290041
CORNEILLEP_ANDROMEDE 3.3951384 2.8881046 1.8740369 1.7497639 1.6851419
CORNEILLEP_CID 3.1328205 2.7110946 1.7286125 0.8805265 1.7795903
CORNEILLEP_ILLUSIONCOMIQUE 3.3480808 2.5887839 1.7577424 1.745785 1.5006577
CORNEILLEP_MEDEE 3.602332 3.0193311 1.9515189 1.0923596 1.2887389
CORNEILLET_AMOURALAMODE 2.6624246 2.2326412 1.8251842 3.0866265 1.2335343
CORNEILLET_ARIANE 2.7007344 1.8146507 1.9785155 2.4276264 1.6083025
... ... ... ... ...
je l à la un
BOYER_AGAMEMNON 1.9183249 1.3850956 1.4306152 1.4501236 1.4501236
BOYER_AMOURSJUPITERSEMELE 1.5692586 1.6245851 1.3378936 1.5441103 2.0068404
BOYER_ARISTODEME 1.8801048 1.5641855 1.5950069 1.6335337 1.3022037
BOYER_ARTAXERCE 1.7217558 1.567648 1.7642683 1.3497715 1.6367308
CORNEILLEP_ANDROMEDE 1.0488641 1.6553164 1.8292986 1.5658398 1.307352
CORNEILLEP_CID 1.5617759 1.8166651 1.8954491 1.3207897 1.3995736
CORNEILLEP_ILLUSIONCOMIQUE 1.9191678 1.4767428 1.4707641 1.2914026 1.53653
CORNEILLEP_MEDEE 1.5526235 1.5219392 2.1172139 1.5771709 1.3930654
CORNEILLET_AMOURALAMODE 2.2270596 1.7526234 1.814021 1.2391159 1.2949319
CORNEILLET_ARIANE 1.9785155 1.8874795 1.8632033 1.1713297 1.2259513
... ... ... ... ...
il
BOYER_AGAMEMNON 0.8258551 ...
BOYER_AMOURSJUPITERSEMELE 1.2121517 ...
BOYER_ARISTODEME 1.3561412 ...
BOYER_ARTAXERCE 1.3603996 ...
CORNEILLEP_ANDROMEDE 1.3272357 ...
CORNEILLEP_CID 1.3485958 ...
CORNEILLEP_ILLUSIONCOMIQUE 1.6321894 ...
CORNEILLEP_MEDEE 1.1660018 ...
CORNEILLET_AMOURALAMODE 1.546104 ...
CORNEILLET_ARIANE 1.8996176 ...
... ...
(total number of rows/columns: 36/5000)
Ces résultats permettent d’évaluer la distance entre chacun des textes de notre corpus. Cette fois les résultats sont accessibles avec le nom de notre variable suivi de $distance.table
resultats$distance.table
--------------------------------------------
final distances between each pair of samples
--------------------------------------------
BOYER_AGAMEMNON BOYER_AMOURSJUPITERSEMELE BOYER_ARISTODEME
BOYER_AGAMEMNON 0 0.9783326 1.015679
BOYER_AMOURSJUPITERSEMELE 0.9783326 0 0.8662667
BOYER_ARISTODEME 1.015679 0.8662667 0
BOYER_ARTAXERCE 1.0074953 0.8271082 0.8554498
CORNEILLEP_ANDROMEDE 1.1921901 0.9871737 0.9188029
CORNEILLEP_CID 1.1766662 1.0303819 0.9174709
CORNEILLEP_ILLUSIONCOMIQUE 1.1041945 1.0079112 0.9935478
CORNEILLEP_MEDEE 1.049137 1.0945042 0.9252656
CORNEILLET_AMOURALAMODE 1.4957435 1.276481 1.3167288
CORNEILLET_ARIANE 1.5266419 1.2316265 1.3232579
... ... ...
BOYER_ARTAXERCE CORNEILLEP_ANDROMEDE CORNEILLEP_CID
BOYER_AGAMEMNON 1.0074953 1.1921901 1.1766662
BOYER_AMOURSJUPITERSEMELE 0.8271082 0.9871737 1.0303819
BOYER_ARISTODEME 0.8554498 0.9188029 0.9174709
BOYER_ARTAXERCE 0 0.9947269 0.8419137
CORNEILLEP_ANDROMEDE 0.9947269 0 1.0300417
CORNEILLEP_CID 0.8419137 1.0300417 0
CORNEILLEP_ILLUSIONCOMIQUE 0.8629873 0.9055432 0.7449658
CORNEILLEP_MEDEE 0.9073128 0.9140746 0.6075916
CORNEILLET_AMOURALAMODE 1.3138351 1.4109982 1.1426195
CORNEILLET_ARIANE 1.1982886 1.3898177 1.1936723
... ... ...
CORNEILLEP_ILLUSIONCOMIQUE CORNEILLEP_MEDEE
BOYER_AGAMEMNON 1.1041945 1.049137
BOYER_AMOURSJUPITERSEMELE 1.0079112 1.0945042
BOYER_ARISTODEME 0.9935478 0.9252656
BOYER_ARTAXERCE 0.8629873 0.9073128
CORNEILLEP_ANDROMEDE 0.9055432 0.9140746
CORNEILLEP_CID 0.7449658 0.6075916
CORNEILLEP_ILLUSIONCOMIQUE 0 0.7263618
CORNEILLEP_MEDEE 0.7263618 0
CORNEILLET_AMOURALAMODE 0.9827696 1.2024798
CORNEILLET_ARIANE 1.1602683 1.2501885
... ...
CORNEILLET_AMOURALAMODE CORNEILLET_ARIANE
BOYER_AGAMEMNON 1.4957435 1.5266419
BOYER_AMOURSJUPITERSEMELE 1.276481 1.2316265
BOYER_ARISTODEME 1.3167288 1.3232579
BOYER_ARTAXERCE 1.3138351 1.1982886
CORNEILLEP_ANDROMEDE 1.4109982 1.3898177
CORNEILLEP_CID 1.1426195 1.1936723
CORNEILLEP_ILLUSIONCOMIQUE 0.9827696 1.1602683
CORNEILLEP_MEDEE 1.2024798 1.2501885
CORNEILLET_AMOURALAMODE 0 0.9378568
CORNEILLET_ARIANE 0.9378568 0
... ...
CORNEILLET_BRADAMANTE
BOYER_AGAMEMNON 1.3632976 ...
BOYER_AMOURSJUPITERSEMELE 1.1469947 ...
BOYER_ARISTODEME 1.1172791 ...
BOYER_ARTAXERCE 1.0711219 ...
CORNEILLEP_ANDROMEDE 1.2529945 ...
CORNEILLEP_CID 1.0225612 ...
CORNEILLEP_ILLUSIONCOMIQUE 1.0268625 ...
CORNEILLEP_MEDEE 1.128626 ...
CORNEILLET_AMOURALAMODE 0.9540644 ...
CORNEILLET_ARIANE 0.6871273 ...
... ...
(total number of rows/columns: 36/36)
Remarquons que ces résultats forment une courbe parfaitement distribuée.
hist(resultats$distance.table)
C’est donc à partir de ces fréquences, puis de ces distances que nous obtenons les dendogrammes que nous avons vus précédemment.
Un mode de visualisation des données assez commun est le Multidimensional scaling (“positionnement multidimensionnel” en français). Pour faire (très, très) simple, il s’agit de spatialiser les résultats.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr=100,
analysis.type = "MDS", distance.measure = "manhattan",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
Calculating z-scores...
Calculating Manhattan distances...
MFW used: 100
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "MDS", distance.measure = "manhattan", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
x = stylo()
this will create a class "x" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(x)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Un des intérêts de ce type de visualisation est d’identifier les auteurs avec les styles les plus neutres, et ceux avec les styles les plus marqués.
Une telle visualisation permet
Un autre mode de visualisation est le principal component analysis (“Analyse en composantes principales” en français), qui permet lui aussi de spatialiser les résultats, selon une autre éthode de calcul.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr=100,
analysis.type = "PCV", distance.measure = "delta",
pca.visual.flavour = "classic")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
MFW used: 100
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "PCV", distance.measure = "delta", pca.visual.flavour = "classic")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
my.stylometric.test = stylo()
this will create a class "my.stylometric.test" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(my.stylometric.test)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Il est possible de superposer les tokens (ici les mots) aux labels, afin de comprendre sur quelles données lexicales s’appuie la spatialisation.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr=100,
analysis.type = "PCV", distance.measure = "delta",
pca.visual.flavour = "loadings")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
MFW used: 100
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "PCV", distance.measure = "delta", pca.visual.flavour = "loadings")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
it.deserves.a.nobel.prize = stylo()
this will create a class "it.deserves.a.nobel.prize" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(it.deserves.a.nobel.prize)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
On le voit, la plupart des tokens ayant des fréquences très faible, on se retrouve avec un “tas” de mots au centre, ce qui rend les données illisibles… Comment faire?
Il est possible de modifier les résultats afin d’accentuer de manière proportionnelle la distance entre les différents tokens pour “aérer” la partie centrale en modifiant légèrement la méthode de calcul.
stylo(gui=FALSE, corpus.dir = "corpus",
corpus.format = "xml.drama", corpus.lang = "French",
analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr=100,
analysis.type = "PCR", distance.measure = "delta",
pca.visual.flavour = "loadings")
using current directory...
Performing no sampling (using entire text as sample)
loading BOYER_AGAMEMNON.xml ...
loading BOYER_AMOURSJUPITERSEMELE.xml ...
loading BOYER_ARISTODEME.xml ...
loading BOYER_ARTAXERCE.xml ...
loading CORNEILLEP_ANDROMEDE.xml ...
loading CORNEILLEP_CID.xml ...
loading CORNEILLEP_ILLUSIONCOMIQUE.xml ...
loading CORNEILLEP_MEDEE.xml ...
loading CORNEILLET_AMOURALAMODE.xml ...
loading CORNEILLET_ARIANE.xml ...
loading CORNEILLET_BRADAMANTE.xml ...
loading CORNEILLET_GEOLIERDESOISMEME.xml ...
loading DURYER_CLARIGENE.xml ...
loading DURYER_CLITOPHON.xml ...
loading DURYER_DYNAMIS.xml ...
loading DURYER_ESTHER.xml ...
loading MOLIERE_AMPHITRYON.xml ...
loading MOLIERE_DOMGARCIEDENAVARRE.xml ...
loading MOLIERE_MISANTHROPE.xml ...
loading MOLIERE_TARTUFFE.xml ...
loading RACINE_BERENICE.xml ...
loading RACINE_ESTHER.xml ...
loading RACINE_IPHIGENIE.xml ...
loading RACINE_PHEDRE.xml ...
loading ROTROU_COSROES.xml ...
loading ROTROU_DEUXPUCELLES.xml ...
loading ROTROU_DOMBERNARDDECABRERE.xml ...
loading ROTROU_HERCULEMOURANT.xml ...
loading SCARRON_DOMJAPHETDARMENIE.xml ...
loading SCARRON_ECOLIERDESALAMANQUE.xml ...
loading SCARRON_FAUSSEAPPARENCE.xml ...
loading SCARRON_GARDIENDESOIMEME.xml ...
loading SCUDERY_MORTDECESAR.xml ...
loading SCUDERY_ORANTE.xml ...
loading SCUDERY_PRINCEDEGUISE.xml ...
loading SCUDERY_VASSALGENEREUX.xml ...
slicing input text into tokens...
turning words into features, e.g. char n-grams (if applicable)...
Total nr. of samples in the corpus: 36
.........................
...........
The corpus consists of 611600 tokens
processing 36 text samples
...
combining frequencies into a table...
culling @ 0 available features (words) 5000
MFW used: 100
Function call:
stylo(gui = FALSE, corpus.dir = "corpus", corpus.format = "xml.drama", corpus.lang = "French", analyzed.features = "w", mfw.min = 100, mfw.max = 100, mfw.incr = 100, analysis.type = "PCR", distance.measure = "delta", pca.visual.flavour = "loadings")
Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.
Advanced users: you can pipe the results to a variable, e.g.:
best.results.ever = stylo()
this will create a class "best.results.ever" containing some presumably
interesting stuff. The class created, you can type, e.g.:
summary(best.results.ever)
to see which variables are stored there and how to use them.
for suggestions how to cite this software, type: citation("stylo")
Il est ainsi possible d’associer certains tokens à des auteurs, ou des groupes d’auteurs.
En bas du graphique, on trouve un pourcentage: il nous donne une idée de la distortion apportée au résultat précédent pour accentuer l’espace entre les mots, et donc le degré de fiabilité du résultat.
stylo.network()